#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2018-09-19 14:12:25
# @Author  : Your Name (you@example.org)
# @Link    : link
# @Version : 1.0.0

import psycopg2

# ip,port,user,db_name, psd



def main():
    ip = '127.0.0.1'
    user = 'postgres'
    db_name = 'postgres'
    psd = '0000'
    port = '5432'
    try:
        conn = psycopg2.connect(
            database=db_name,
            user=user,
            password=psd,
            host=ip,
            port=port)
        conn.set_client_encoding("utf-8")
    except Exception as e:
        return None

    return conn


if __name__ == '__main__':
    pass
